<SCRIPT type="text/javascript">
	var setting = {
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
			//onCollapse: alert("up"),
			onExpand: function(){
				if (treeNiceScroll) {
					treeNiceScroll.resize();
				}
			}
		},
		view: {
			showLine: false
		}
	};
	var zNodes1 =[
		{ id:1, pId:0, name:"数据库链接", open:true, icon:"/assets/images/icon-file-closed.png"}
		<#if databaseList??>
		<#assign curid = "">
		<#list databaseList as db>
		<#assign curid = db.id>
		,{ id:'${db.id!''}', pId:1,name:"<#if db.connctiontype??&&db.connctiontype=='jdbc'>${db.name!''}(jdbc)<#elseif db.connctiontype??&&db.connctiontype=='jndi'>${db.jndiname!''}(jndi)</#if>", open:<#if dbid == db.id>true<#else>false</#if>,url:"/${orgi}/dm/database/${db.id!''}/database.html",target:"_self", icon:"/assets/images/<#if db.databasetype??&&db.databasetype == 'oracle'>imgIco-101<#elseif db.databasetype??&&db.databasetype == 'mysql'>imgIco-100<#elseif db.databasetype??&&db.databasetype == 'sqlserver'>imgIco-102<#elseif db.databasetype??&&db.databasetype == 'rivues'>imgIco-10<#else>imgIco-13</#if>.png"}
		,{ id:"${db.id!''}_0", pId:"${db.id!''}", open:false , name:"默认目录",url:"/${orgi}/dm/database/${db.id!''}/tabledir/0.html",target:"_self", icon:"/assets/images/icon-file-closed.png"}
		,{ id:"${db.id!''}_1", pId:"${db.id!''}", open:false , name:"结算数据",url:"/${orgi}/dm/database/${db.id!''}/tabledir/1.html",target:"_self", icon:"/assets/images/icon-file-closed.png"}
		<#if tabledirList??>
			<#list tabledirList as tabledir>
			  <#if tabledir.databaseid??&&tabledir.databaseid == db.id>	
			  ,{ id:"${tabledir.id!''}", pId:"<#if tabledir.parentid=='0'>${curid!''}<#else>${tabledir.parentid!''}</#if>", open:<#if curdataid == tabledir.id>true<#else>false</#if> , name:"${tabledir.name!''}",url:"/${orgi}/dm/database/${db.id!''}/tabledir/${tabledir.id!'0'}.html",target:"_self", icon:"/assets/images/icon-file-closed.png"}
			  </#if>
			</#list>
			<#assign curid = db.id>
		</#if>
		</#list>
		</#if>
	];
	$(document).ready(function(){
		var ztree = $.fn.zTree.init($(document.getElementById("zTree_adminLIst")), setting, zNodes1);
		ztree.selectNode(ztree.getNodeByParam("id", "<#if curdataid?? && curdataid == '0'>${dbid}_0<#elseif curdataid?? && curdataid == '1'>${dbid}_1<#else>${curdataid!''}</#if>", null));
		$(".nav_tabwps_3").rs_simpleTabs({
			tabElem				:".nav_tapIthems",			//切换标签的子元素
			tabCurrent			:"cur",						//切换标签的Current状态
			tabCont				:".nav_tabwps_3con",		//切换的元素内容父级
			tabContLayer		:".nav_tabwps_3_layouts",	//切换的元素内容层
			tabContLayerShow	:"show",					//切换的元素Current状态
			afclick				:null						//回调函数接口			
		});	 
	});
</SCRIPT>

<div class="rs_layout_top breadCrumbWrap">
	<div class="breadCrumbStart">您当前的位置是在：</div>
	<ul class="breadCrumb">
		<li class="bc_ithems"><a href="/${orgi}/dm/database/index.html">数据库连接</a></li>
		<#if database??>
		<li class="bc_ithems"><a href="/${orgi}/dm/database/${database.id!''}/database.html">${database.name!''}</a></li>
		</#if>
		<#if table??>
		<li class="bc_ithems"><a href="/${orgi}/dm/database/${database.id!''}/${parentid}/table/${table.id!''}.html">${table.name!''}</a></li>
		</#if>
	</ul>
	<ul class="controlButtons">
		<li class="cbtn-icon-33" data-toggle="ajax" id="newreport" href="/${orgi}/dm/database/databaseadd.html" title="添加数据库"></li>
		<#if dbid??>
		<li class="cbtn-icon-35" data-toggle="ajax" id="newreport" href="/${orgi}/dm/database/databaseedit/${dbid!''}.html" title="修改数据库"></li>
		<#if parentid=="0">
		<li class="cbtn-icon-36" onclick="art.confirm('您确定要删除此数据库链接吗？' , function(){location.href='/${orgi}/dm/database/databasedelo/${dbid}.html'} , function(){})"
		title="删除数据库"></li>
		</#if>
		<li class="cbtn-icon-3" data-toggle="ajax" id="newreport" href="/${orgi}/dm/database/${dbid!''}/tablediradd/${parentid!'0'}.html" data-width="480" title="创建目录"></li>
		<#if parentid?? && parentid != "0">
		<li class="cbtn-icon-38" data-toggle="ajax" id="newreport" href="/${orgi}/dm/database/${dbid!''}/tablediredit/${parentid!''}.html" data-width="480" title="修改目录"></li>
		</#if>
		<#if parentid!="0">
		<li class="cbtn-icon-39" id="del"  
		onclick="art.confirm('您确定要删除此目录吗？' , function(){location.href='/${orgi}/dm/database/tabledirdelo/${parentid}.html'} , function(){})"
		 title="删除目录"></li>
		
		</#if>
		
		<li class="cbtn-icon-4" data-toggle="ajax" data-callback="doTableMsg"  id="newreport"  href="/${orgi}/dm/database/${dbid!''}/tableadd/${parentid!'0'}.html" title="导入数据表"></li>
		<li class="cbtn-icon-37" data-toggle="ajax" id="newreport" href="/${orgi}/dm/database/${dbid!''}/sqladd/${parentid!'0'}.html" title="导入SQL查询"></li>
		</#if>
	</ul>
</div>
<div class="rs_layout_left" resizable="true" style="width:230px;">
	<div class="lftTreeWrap">
		<div class="ztree" id="zTree_adminLIst"></div>
	</div>
</div>